namespace SimpleProject;

/// <summary>
/// A simple calculator class for demonstration
/// </summary>
public class Calculator
{
    private int _lastResult;

    /// <summary>
    /// Gets or sets the name of the calculator
    /// </summary>
    public string Name { get; set; } = "SimpleCalculator";

    /// <summary>
    /// Initializes a new instance of the Calculator class
    /// </summary>
    public Calculator()
    {
        _lastResult = 0;
    }

    /// <summary>
    /// Initializes a new instance of the Calculator class with a name
    /// </summary>
    public Calculator(string name)
    {
        Name = name;
        _lastResult = 0;
    }

    /// <summary>
    /// Adds two numbers
    /// </summary>
    public int Add(int a, int b)
    {
        _lastResult = a + b;
        return _lastResult;
    }

    /// <summary>
    /// Subtracts two numbers
    /// </summary>
    public int Subtract(int a, int b)
    {
        _lastResult = a - b;
        return _lastResult;
    }

    /// <summary>
    /// Gets the last calculated result
    /// </summary>
    public int GetLastResult()
    {
        return _lastResult;
    }
}
